<html>
<body>
<h1>jUnit Plugin</h1>
<p>
    The jUnit plugin runs unit and integration tests using the jUnit test framework.
</p>

<div id="after-summary">
<p><b>Properties:</b></p>
<p>The following properties are common to be targets. All properties are optional unless stated otherwise.</p>
<table>
<tbody>
<tr>
    <td valign="top">printSummary</td>

    <td>Print one-line statistics for each testcase. Can
        take the values <code>on</code>,
        <code>off</code>, and
        <code>withOutAndErr</code>.
        <code>withOutAndErr</code> is the same
        as <code>on</code> but also includes the output of the test
        as written to <code>System.out</code> and <code>System.err</code>.
        Defaults to <code>off</code>.
    </td>
</tr>
<tr>
    <td valign="top">fork</td>
    <td>Run the tests in a separate VM. Default is false if unspecified, but the quokka default is true</td>
</tr>
<tr>
    <td valign="top">forkMode</td>
    <td>Controls how many Java Virtual Machines get
        created if you want to fork some tests. Possible values are
        "perTest" (the default), "perBatch" and
        "once". "once" creates only a single Java VM
        for all tests while "perTest" creates a new VM for each
        TestCase class. "perBatch" creates a VM for each nested
        <code>&lt;batchTest&gt;</code> and one collecting all nested
        <code>&lt;test&gt;</code>s. Note that only tests with the same
        settings of <code>filterTrace</code>, <code>haltOnError</code>,
        <code>haltOnFailure</code>, <code>errorProperty</code> and
        <code>failureProperty</code> can share a VM, so even if you set
        <code>forkMode</code> to "once", Ant may have to create
        more than a single Java VM. This attribute is ignored for tests
        that don't get forked into a new Java VM. Default if unspecified is perTest,
        but the quokka default is once.
    </td>
</tr>
<tr>
    <td valign="top">haltOnError</td>
    <td>Stop the build process if an error occurs during the test
        run. No; default is <code>off</code>
    </td>
</tr>
<tr>
    <td valign="top">errorProperty</td>
    <td>The name of a property to set in the event of an error.</td>
</tr>
<tr>
    <td valign="top">haltOnFailure</td>
    <td>Stop the build process if a test fails (errors are
        considered failures as well). Default is <code>off</code>
    </td>
</tr>
<tr>
    <td valign="top">failureProperty</td>
    <td>The name of a property to set in the event of a failure
        (errors are considered failures as well).
    </td>
</tr>
<tr>
    <td valign="top">filterTrace</td>
    <td>Filter out Junit and Ant stack frames from error and failure stack traces. Default is <code>on</code>.</td>
</tr>
<tr>
    <td valign="top">timeout</td>
    <td>Cancel the individual tests if they don't finish
        in the given time (measured in milliseconds). Ignored if
        <code>fork</code> is disabled.
    </td>
</tr>

<tr>
    <td valign="top">maxMemory</td>
    <td>Maximum amount of memory to allocate to the forked VM.
        Ignored if <code>fork</code> is disabled.
    </td>
</tr>
<tr>
    <td valign="top">jvm</td>
    <td>The command used to invoke the Java Virtual Machine,
        default is 'java'. The command is resolved by
        <code>java.lang.Runtime.exec()</code>.
        Ignored if <code>fork</code> is disabled. Default is <code>java</code>.</td>
</tr>

<tr>
    <td valign="top">dir</td>
    <td>The directory in which to invoke the VM. Ignored if
        <code>fork</code> is disabled.
    </td>
</tr>
<tr>

    <td valign="top">newEnvironment</td>
    <td>Do not propagate the old environment when new
        environment variables are specified. Ignored if <code>fork</code> is
        disabled.Default is <code>false</code>.</td>
</tr>
<tr>
    <td valign="top">showOutput</td>
    <td>Send any output generated by tests to Ant's
        logging system as well as to the formatters. By default only the
        formatters receive the output.
    </td>
</tr>
<tr>
    <td valign="top">outputToFormatters</td>
    <td>
        Send any output generated by tests to the test formatters.
        This is "true" by default.
    </td>
</tr>
<tr>
    <td valign="top">tempDir</td>
    <td>Where Ant should place temporary files.Default is the project's base
        directory.
    </td>
</tr>
<tr>
    <td valign="top">reloading</td>

    <td>Whether or not a new classloader should be instantiated for each test case.<br/>
        Ignore if <code>fork</code> is set to true. Default is <code>true</code>.</td>
</tr>

<tr>
    <td valign="top">cloneVm</td>
    <td>If set to true true, then all system properties
        and the bootClassPath of the forked Java Virtual Machine will be
        the same as those of the Java VM running Ant. Default is
        "false" (ignored if fork is disabled).
    </td>
</tr>
<tr>
    <td valign="top">jvmArgs</td>
    <td>Arguments passed to the JVM when the unit tests are forked.
    </td>
</tr>
<tr>
    <td valign="top">sysproperty</td>
    <td>A map of system properties passed to the JVM when forked. e.g.
        <code>sysproperty[key]=value</code> sets a system property of <code>key</code> to <code>value</code>. 
    </td>
</tr>
</tbody>
</table>
<br/>
<p><b>Nested Properties:</b></p>
<p><b>batchTest</b> is the root of a map of batch tests. Each batchTest has the following properties.
    See the default properties above for an example.</p>
<table>
    <tbody>
        <tr>
            <td valign="top">rc</td>
            <td>A quokka resource collection (e.g. a file set).
            </td>
        </tr>
        <tr>
            <td valign="top">fork</td>
            <td>Run the tests in a separate VM.
                Overrides value set in <code>&lt;junit&gt;</code>.
            </td>
        </tr>
        <tr>
            <td valign="top">haltOnError</td>
            <td>Stop the build process if an error occurs during the test
                run. Overrides value set in <code>&lt;junit&gt;</code>.
            </td>
        </tr>
        <tr>
            <td valign="top">errorProperty</td>
            <td>The name of a property to set in the event of an error.
                Overrides value set in <code>&lt;junit&gt;</code>.
            </td>
        </tr>
        <tr>
            <td valign="top">haltOnFailure</td>
            <td>Stop the build process if a test fails (errors are
                considered failures as well). Overrides value set in
                <code>&lt;junit&gt;</code>.
            </td>
        </tr>
        <tr>
            <td valign="top">failureProperty</td>
            <td>The name of a property to set in the event of a failure
                (errors are considered failures as well). Overrides value set in
                <code>&lt;junit&gt;</code></td>
        </tr>
        <tr>
            <td valign="top">filterTrace</td>
            <td>Filter out Junit and Ant stack frames from error and failure stack
                traces. Overrides value set in <code>&lt;junit&gt;</code>.
            </td>
        </tr>
        <tr>
            <td valign="top">toDir</td>
            <td>Directory to write the reports to.Default is the current directory.</td>
        </tr>
        <tr>
            <td valign="top">if</td>
            <td>Only run tests if the named property is set.</td>
        </tr>
        <tr>
            <td valign="top">unless</td>
            <td>Only run tests if the named property is <strong>not</strong> set.</td>
        </tr>
    </tbody>
</table>
<br/>
<p><b>formatter</b></p>
<p>The results of the tests can be printed in different
    formats. Output will always be sent to a file, unless you set the
    <code>useFile</code> attribute to <code>false</code>.
    The name of the file is determined by the
    name of the test and can be set by the <code>outfile</code> attribute
    of <code>&lt;test&gt;</code>.</p>

<p>There are three predefined formatters - one prints the test results
    in XML format, the other emits plain text. The formatter named
    <code>brief</code> will only print detailed information for testcases
    that failed, while <code>plain</code> gives a little statistics line
    for all test cases. Custom formatters that need to implement
    <code>org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter</code>
    can be specified.</p>

<p>If you use the XML formatter, it may not include the same output
    that your tests have written as some characters are illegal in XML
    documents and will be dropped.</p>

<p> See the default properties above for an example.</p>
<table>
    <tbody>
        <tr>
            <td valign="top">type</td>

            <td>Use a predefined formatter (either
                <code>xml</code>, <code>plain</code>, or <code>brief</code>).
            </td>
        </tr>
        <tr>
            <td valign="top">className</td>

            <td>Name of a custom formatter class.</td>
        </tr>
        <tr>
            <td valign="top">extension</td>
            <td>Extension to append to the output filename. Mandatory if <code>className</code> has been used.</td>
        </tr>
        <tr>
            <td valign="top">useFile</td>
            <td>Boolean that determines whether output should be
                sent to a file.Default is <code>true</code>.</td>
        </tr>

        <tr>
            <td valign="top">if</td>
            <td>Only use formatter if the named property is set. Default is <code>true</code>.</td>
        </tr>
        <tr>
            <td valign="top">unless</td>
            <td>Only use formatter if the named property is <b>not</b> set. Default is <code>true</code>.</td>
        </tr>
    </tbody>
</table>
</div>
</body>
</html>